#pragma once
#include <iostream>
#include "Component\Renderer\Tools\Texture.h"
#include "Core\Cardinal.h"
#include "Core\Item.h"
#include "Includes\SDefine.h"
#include "Tools\Ref.h"
#include "Tools\Serialization.h"
namespace SakuraAge {
class Shader : public SakuraObject, public RefBase<Shader> {
  friend class RefBase<Shader>;

 private:
  unsigned int VBO, VAO, EBO;
  bool useEBO;
  unsigned int shaderProgram;
  ObjRef<Texture> texture;
  Shader();  // For Serialize
 public:
  Shader(const std::string& Path, bool useEBO = false,
         ObjRef<Texture> = nullptr);
  void Render(float* vertices, unsigned size, int* elements,
              unsigned int points) const;
  void SetFloat(const GLchar* name, GLfloat f) const;
  void SetInt(const GLchar* name, GLint i) const;
  void SetVector2(const GLchar* name, GLfloat x, GLfloat y) const;
  void SetColor(const GLchar* name, float r, float g, float b, float a) const;
  virtual void Serialize(SerializedStream& ss) const;
};
}  // namespace SakuraAge
